// -----------------------------------------------------------------------
//  <copyright file="ResourceTreeNode.cs" company="LiuliuSoft">
//      Copyright (c) 2022-2025 DaprPlus. All rights reserved.
//  </copyright>
//  <site>https://dapr.plus</site>
//  <last-editor>郭明锋</last-editor>
//  <last-date>2025-02-28 23:02</last-date>
// -----------------------------------------------------------------------

using DaprPlus.Authorization.Domain.Entities;


namespace DaprPlus.Authorization.Application.Queries;

/// <summary>
/// 资源树节点输出DTO
/// </summary>
[MapFrom(typeof(Resource))]
public class ResourceNode
{
    /// <summary>
    /// 获取或设置 资源ID
    /// </summary>
    public long Id { get; set; }

    /// <summary>
    /// 获取或设置 资源名称
    /// </summary>
    public required string Name { get; set; }

    /// <summary>
    /// 获取或设置 资源代码
    /// </summary>
    public required string Code { get; set; }

    /// <summary>
    /// 获取或设置 资源描述
    /// </summary>
    public string? Description { get; set; }

    /// <summary>
    /// 获取或设置 资源类型
    /// </summary>
    public ResourceType Type { get; set; }

    /// <summary>
    /// 获取或设置 是否选中
    /// </summary>
    public bool IsSelected { get; set; }

    /// <summary>
    /// 获取或设置 选中的操作列表
    /// </summary>
    public string[] Operations { get; set; } = [];

    /// <summary>
    /// 获取或设置 允许的操作列表
    /// </summary>
    public ResourceOperation[] AllowedOperations { get; set; } = [];
}
